// For edit input boxes only. The Ctrl.fcus is not applicable to radio buttons and gives an error
function validatePrompt (Ctrl, PromptStr)
{
alert (PromptStr)
Ctrl.focus();
return;
}
function Acknowledge (Ctrl, PromptStr)
{
alert (PromptStr)
return;
}
function ShowMsgILoveIt(form)
{
Ctrl = form.Liking;
if (!loveIt)
{
Acknowledge (Ctrl, "Thank you very kindly. I am glad that you visited my page.\n You are a valued vistor. Please do visit me again and do remember to sign my guest book!!");
noComment = 0;
likeIt = 0;
loveIt = 1;
}
else loveIt = 0;
}
function ShowMsgILikeIt(form)
{
Ctrl = form.Liking;
if (!likeIt)
{
Acknowledge (Ctrl, "Thank you! May I have your suggestions to further improve my page so that one will say 'I LOVE IT' !!");
noComment = 0;
likeIt = 1;
loveIt = 0;
}
else likeIt = 0;
}
function ShowMsgNoComment(form)
{
Ctrl = form.Liking;
if (!noComment)
{
Acknowledge (Ctrl, "Thank you for your time in advance. Would you kindly spare a moment to tell me which aspect of my page(s) needs improvement?");
noComment = 1;
likeIt = 0;
loveIt = 0;
}
else noComment = 0;
}
function ShowMsgItIsCool(form)
{
Ctrl = form.User_description_a;
if (!itIsCool)
{
Acknowledge (Ctrl, "Thank you very very much. I am flattered!.\n Please do sign the guestbook and please visit my page again.");
itIsCool = 1;
}
else itIsCool = 0;
}
function ShowMsgItIsHot(form)
{
Ctrl = form.User_description_b;
if (!itIsHot)
{
Acknowledge (Ctrl, "Thank you very much. I am glad that you liked my page. Please visit again.");
itIsHot = 1;
}
else itIsHot = 0;
}
function ShowMsgItIsJazzy(form)
{
Ctrl = form.User_description_c;
if (!itIsJazzy)
{
Acknowledge (Ctrl, "Thank you, kindly. I will try to make it jazzier on your next visit. Please sign the book.");
itIsJazzy = 1;
}
else itIsJazzy = 0;
}
function ShowMsgItIsNormal(form)
{
Ctrl = form.User_description_d;
if (!itIsNormal)
{
Acknowledge (Ctrl, "Thank you. Please visit my page again.");
itIsNormal = 1;
}
else itIsNormal = 0;
}
function ShowMsgIWantIt(form)
{
Ctrl = form.User_said;
if (!IWantIt)
{
Acknowledge (Ctrl, "Certainly. You can save this page into a HTML file and edit it to suit you.\n Alternatively, you can download Guest*Star, the program that writes guestbook and its CGI, from http://www.webgenie.com/software/guestar.html.");
IWantIt = 1;
}
else IWantIt = 0;
}
function TestEmailBox(form) {
// Check the User name
Ctrl = form.Visitor_name;
if (Ctrl.value == "")
{
if (!secondTimeName)
{
validatePrompt (Ctrl, "You haven't specified your name.\nPlease type it in, or if you prefer not to enter it, press the submit button again to record your visit.")
validatePrompt (Ctrl, "You haven't specified your E_mail address.\nPlease type it in, or if you prefer not to enter it, press the submit button again to record your visit.")
secondTimeEmail = 1;
return false;
}
}
return true;
}
function runSubmit (form, button)
{
if (TestEmailBox(form))
{
Ctrl = form.Submit;
// What does the user say?
if (loveIt || likeIt || itIsCool || itIsJazzy)
{
Acknowledge (Ctrl, "Thank you for signing my guest book and special thanks for your good comments.\n Please view my guest book to see your entry.")
}
else
{
Acknowledge (Ctrl, "Thank you for signing my guest book.\n Please view my guest book to see your entry.")